package com.example.project22_editingmediaplayer;
import java.util.ArrayList;

import com.example.project22_editingmediaplayer.objects.SongObject;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
 
public class ViewPagerAdapter extends FragmentPagerAdapter {
    private Context _context;
    private FragmentManager fm;
    public ViewPagerAdapter(Context context, FragmentManager fm) {
        super(fm);
        _context=context;
        fm=fm;
 
        }
    @Override
    public Fragment getItem(int position) {
        Fragment f = new Fragment();
        switch(position){
        case 0:
            f=LayoutAllSong.newInstance(_context);
            break;
        case 1:
            f=LayoutArtists.newInstance(_context);
            break;
        case 2:
        	f=LayoutAlbums.newInstance(_context);
        	break;
        case 3:
        	f=LayoutRecent.newInstance(_context);
        	break;
        case 4:
        	f=LayoutPlaylist.newInstance(_context);
        	break;
        case 5:
        	f=LayoutGenres.newInstance(_context);
        	break;
        }
        return f;
    }
    @Override
    public int getCount() {
        return 6;
    }
    public void resetData() {
		this.notifyDataSetChanged();
	}
 
}